package com.wdy.balking;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * @ClassName: App
 * @Description: TODO
 * @Date: 2019/12/31 9:45
 * @Author: wangdy001
 * @Version: 1.0
 */
public class App {
    public static void main(String[] args) {
        WashingMachine washing = new WashingMachine();
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        for (int i = 0; i < 3; i++) {
            executorService.submit(washing::washing);
        }

        try {
            executorService.awaitTermination(5000, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
